{include admin.inc.header}

{include admin.inc.top}
<style>
    .drop-area {
        width: 162px;
        height: 180px;
        padding: 0px;
        border: 1px dashed silver;
        color: #aaa;
        text-align: center;
        border-radius: 1px;
        background-repeat: no-repeat;
        background-position: center center;
        background-color: #efefef;
        cursor: pointer;
        /*overflow: scroll;
        overflow: auto;
        overflow-x: hidden;*/
    }
    .drop-area img {
        width: 160px;
        height: 177px;

    }
</style>
<div class="container-fluid content-body">
    <div class="main">
        {include admin.inc.menu}

        <section class="right-section" id="right-section">
            <!-- start of inner-frame -->
            <div class="inner-iframe">
                <ul class="breadcrumb">
                    <li>
                        <i class="glyphicon glyphicon-home"></i>
                        <span>当前位置：</span>
                        <a href="#">{$breadcrumb[0]}</a>
                        <i class="glyphicon glyphicon-chevron-right"></i>
                        <a href="#">{$breadcrumb[1]}</a>
                    </li>
                </ul>

                <!-- Nav tabs -->
                <ul class="nav nav-tabs">
                    <li><a href="{$index_url}"><i class="glyphicon glyphicon-th-list"></i> 行情分析列表</a></li>
                    <li class="active"><a href="add"><i class="glyphicon glyphicon-edit"></i> 添加行情分析</a></li>
                </ul>

                <div class="inner-container">

                    <form role="form" class="content-add-form form-horizontal" id="content-add-form" autocomplete="off">

                        <div class="form-group">
                            <label class="col-sm-2 control-label"><span class="asterisk">*</span> 选择品类</label>
                            <div class="col-sm-8">
                                <select name="data[product_name]" class="form-control input-sm ">

                                    <?php foreach($productNameByHotArr as $productNameByHot){ ?>

                                          <?php if($productNameByHot==$item['product_name']){ ?>

                                             <option selected value="{$productNameByHot}">{$productNameByHot}</option>

                                          <?php }else{ ?>


                                             <option  value="{$productNameByHot}">{$productNameByHot}</option>

                                          <?php } ?>

                                    <?php } ?>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">封面图</label>
                            <div class="col-sm-4">

                                <div id="drop-area" class="drop-area">
                                    {if $item[surface_image]!=''}
                                    <img src="{$item[surface_image]}">
                                    {else}
                                    <span style="margin-top: 40%;display: block;">照片最佳尺寸169*177<br/>大小不能超过1M</span>

                                    {/if}

                                </div>
                                <input id="files-upload" type="file" name="photo" data-name="照片"/>

                                <div class="pull-left">
                                    <input type="hidden" name="data[surface_image]" value="{$item[surface_image]}" >
                                </div>


                            </div>
                        </div>

                        <!-- editor -->
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><span class="asterisk">*</span>正文</label>
                            <div class="col-sm-8">
                                <textarea required cname="资讯内容" id="editor-content" class="form-control editor"
                                          style="width: 100%; height: 240px;"
                                          name="data[content]">{$item.content}</textarea>
                                <p class="help-block"></p>
                            </div>
                        </div>
                        <input type="hidden" name="id" value="{$item[id]}" >

                        <div class="form-group">
                            <div class="col-sm-offset-2 col-sm-10">
                                <div class="btn-group btn-group-or">
                                    <a href="{$update_url}" class="btn btn-primary ajaxproxy" id="submit_btn"
                                       proxy='{"method":"post", "location":"{$index_url}"}'>提交保存</a>

                                </div>
                            </div>
                        </div>

                    </form>

                </div>
            </div><!-- end of inner -->

        </section>

    </div>
</div>

{include admin.inc.footer}

<script>
    seajs.use("quoteAnalysisAdd", function (exports) {
        exports.upload_url = "{$upload_url}";
        exports.init({
            check_url: '/admin/manager/exists',
        });
    });
</script>
</body>
</html>
